package com.system.boot.setting.converter;

import com.system.api.setting.entity.dto.DictFormDto;
import com.system.api.setting.entity.po.SysDict;
import com.system.api.setting.entity.po.SysIcon;
import com.system.api.setting.entity.search.DictSearch;
import com.system.api.setting.entity.search.IconSearch;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.yang.database.orm.entity.BaseQuery;

/**
 * @author: lslands
 * @version: 1.0
 * @create: 2024/5/19
 * @description:
 */
@Mapper(builder = @org.mapstruct.Builder(disableBuilder = true),componentModel = "spring")
public interface DictConverter {
    DictConverter INSTANCE = Mappers.getMapper(DictConverter.class);

    /**
     * 转换 dtoForm -> po
     * @param formDto 插入对象
     * @return SysDict
     */
    SysDict formEntity(DictFormDto formDto);


    /**
     * 转换 search -> BaseQuery
     * @param search 搜索对象转换
     * @return BaseQuery
     */
    BaseQuery queryEntity(DictSearch search);

    /**
     * 转换 search -> po
     * @param search 搜索对象转换
     * @return BaseQuery
     */
    SysDict queryPoEntity(DictSearch search);
}
